{% load static %}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>登录</title>
    <meta name="description" content="登录">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
          integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <link rel="stylesheet" href="{% static 'css/login.css' %}">
</head>

<body>
<div class="container-fluid" id="body_container">
    <div class="row">
        <div class="col px-0">
            <nav class="navbar navbar-light bg-light navbar-expand">
                <a class="navbar-brand" href="#">学生信息管理系统</a>
            </nav>
        </div>
    </div>
    <!-- 提示信息 -->
    {% if login_form.captcha.errors %}
        <h5 class="page-header" style="margin-top: 20px"></h5>
        <div class="alert alert-warning alert-dismissible fade show" role="alert">
            <strong>{{ login_form.captcha.errors }}</strong>
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
    {% elif message_warn %}
        <h5 class="page-header" style="margin-top: 20px"></h5>
        <div class="alert alert-warning alert-dismissible fade show" role="alert">
            <strong>{{ message_warn }}</strong>
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
    {% endif %}
    <h5 class="page-header" style="margin-top: 120px"></h5>
    <div class="row">
        <div class="col-2">
        </div>
        <div class="col-2">
            <p class="lead">生命是以时间为单位的，</p>
            <p class="lead">浪费别人的时间等于谋财害命；</p>
            <p class="lead">浪费自己的时间，</p>
            <p class="lead">等于慢性自杀。</p>
            <p class="lead">——鲁迅</p>
        </div>
        <div class="col-2">
            <img src="{% static 'images/image2.jpg' %}" class="img-fluid" alt="image2">
        </div>
        <div class="col-4">
            <div class="card">
                <div class="card-header text-center">
                    <p class="h5">登录</p>
                </div>
                <div class="card-body">
                    <form action="/login/" class="form-login" method="post">
                        {% csrf_token %}
                        <div class="form-group">
                            {{ login_form.username }}
                            <small class="form-text text-muted">
                                用户名长度必须为2-18位,不能出现空格\特殊字符\表情
                            </small>
                        </div>
                        <div class="form-group">
                            {{ login_form.password }}
                            <small id="passwordHelpBlock" class="form-text text-muted">
                                密码长度必须为6-18位, 包括大小写和数字, 不能出现空格\特殊字符\表情
                            </small>
                        </div>
                        <div class="form-group">
                            {{ login_form.captcha.label_tag }}
                            {{ login_form.captcha }}
                            <small class="form-text text-muted">
                                为防止机器人入侵，请完成上方验证
                            </small>
                        </div>
                        <button type="submit" class="btn btn-success btn-block">登录</button>
                        <h5 class="page-header" style="margin-top: 20px"></h5>
                        <button type="button" class="btn btn-primary btn-block"
                                onclick="window.location.href='{% url 'sims:register' %}'">注册
                        </button>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-2"></div>
    </div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
        integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
        integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>
<script src="https://kit.fontawesome.com/9900f8e783.js" crossorigin="anonymous"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/javascript.util/0.12.8/javascript.util.min.js"></script>
<script src="" async defer></script>
</body>

</html>